/**
 * 驼峰转下划线
 * @param str 
 * @returns 
 */
export function camelToUnderline(str: string) {
    let tuo = '';
    let arr = str.split('');
    let newArr = arr.map((ite: string, idx: any) => {
        return ite.toUpperCase() === ite && ite!=='_' ? ite = '_' + ite.toLowerCase() : ite
    })
    tuo = newArr.join('');
    return tuo;
}



export function underlineToCamel(str: string) {
    let feng = '';
    let arr = str.split('_');
    let newArr = arr.map((ele: string | any[], idx: number) => {
        return idx === 0 ? ele : ele[0].toUpperCase() + ele.slice(1)
    })
    feng = newArr.join(``);
    return feng;
}